import { StorageInterface } from '/@/storage/CommonStorage.ts';

/**
 * 项目级存储，点击浏览器刷新按钮，或者手动修改路由时失效
 */
export class ProjectStorage implements StorageInterface {
  private readonly _storage: Map<string, any>

  constructor() {
    this._storage = new Map()
  }

  get(key: string) {
    return this._storage.get(key)
  }

  set(key: string, value: any) {
    this._storage.set(key, value)
  }

  has(key: string) {
    return this._storage.has(key)
  }

  getOriginalObject() {
    return this._storage
  }
}
